﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Game.Utilities
{
    [Serializable]
    public class DBAccount
    {
        public virtual void Dispose()
        {
        }

        public long AccountID { get; set; }
        public string AccountName { get; set; }
        public long TotalBalance { get; set; }
        public DateTime CreateDate { get; set; }

        public void Insert()
        {
            DBHelper db = new DBHelper(Config.Config.LogDBConnectionString);
            SqlCommand oCommand = new SqlCommand("sp_Account_Insert");
            oCommand.CommandType = CommandType.StoredProcedure;
            oCommand.Parameters.Add(new SqlParameter("@AccountID", AccountID));
            oCommand.Parameters.Add(new SqlParameter("@AccountName", AccountName));
            oCommand.Parameters.Add(new SqlParameter("@TotalBalance", TotalBalance));

            db.ExecuteNonQuery(oCommand);
        }
    }
}
